#!/usr/bin/env bash
############################################################################
# https://www.cnblogs.com/fnlingnzb-learner/p/10657285.html
# 在脚本的开头，使用『#!/usr/bin/env bash』替换『#!/bin/sh』，防止在不同操作系统上『/bin/sh』链接到不同版本的默认shell;
############################################################################
# SCRIPTS_DIR="$( cd "$( dirname "$0" )" && pwd )"
# cd "${SCRIPTS_DIR}"
# if [ $? -ne 0 ]; then echo "[ERROR] coordinate: [$0][${LINENO}]"; exit 1; fi
############################################################################

declare -a array_tag
idx=0
array_tag[((idx++))]="reqQryInstrument,"
array_tag[((idx++))]="onRspQryInstrument,"
array_tag[((idx++))]="reqQryInvestorPosition,"
array_tag[((idx++))]="onRspQryInvestorPosition,"
array_tag[((idx++))]="reqQryTradingAccount,"
array_tag[((idx++))]="onRspQryTradingAccount,"
pattern=$(IFS=\|; echo "${array_tag[*]}")

tail -f "$1" | grep -vE --line-buffered "${pattern}" | grep --line-buffered "ctp_gateway.py"
